import 'dart:convert';

import 'package:convert/convert.dart';
import 'package:crypto/crypto.dart' as crypto;

int sum({int a: 10, int b: 20}) {
  return a + b;
}

void main() {
  User user = new User('larry', 20);
  user.walk();
  user.printMd5();
  user.fuck();
  print(sum(b: 12, a: 1));
}

class MD5 {
  String md5(String str) {
    var content = new Utf8Encoder().convert(str);
    var digest = crypto.md5.convert(content);
    return hex.encode(digest.bytes);
  }
}

class Shit {
  void fuck() {
    print('fuck');
  }
}

class Person {
  void walk() => print('walking man...');
}

class User extends Person with MD5, Shit {
  String username;
  int age;

  User(this.username, this.age);

  String toString() => 'User<$username,$age>';

  void printMd5() {
    print(md5(username));
  }
}
